package com.token.zhuishushenqi.community.ui;

import android.os.Bundle;
import android.support.v4.view.ViewPager;
import android.widget.ListView;

import com.token.zhuishushenqi.R;
import com.token.zhuishushenqi.community.adapter.CommunityViewpagerAdapter;
import com.token.zhuishushenqi.other.base.BaseActivity;
import com.token.zhuishushenqi.other.widget.ViewPagerIndicator;

import java.util.ArrayList;
import java.util.List;

//动态Activiyty
public class DynamicActiviyty extends BaseActivity {



    private String[] tData = {"动态", "热门", "我的"};

    private ViewPager dyViewPager;
    private ViewPagerIndicator dyIndicator;
    private CommunityViewpagerAdapter dyAdapter;
    private List<String> data;

    ListView listView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        listView = (ListView) findViewById(R.id.hot_lv);

    }

    @Override
    protected int getActivityid() {
        return R.layout.activity_dynamic_activiyty;
    }

    @Override
    protected void initialize() {
        dyViewPager = (ViewPager) findViewById(R.id.dynamic_viewPager);
        dyIndicator = (ViewPagerIndicator) findViewById(R.id.dynamic_viewPagerIndicator);
        data = new ArrayList<>();
        for (String ldata : tData) {
            data.add(ldata);
        }

        dyAdapter = new CommunityViewpagerAdapter(getSupportFragmentManager());
        dyViewPager.setAdapter(dyAdapter);

        dyIndicator.setViewPager(dyViewPager,1);
    }

    @Override
    protected void loadData() {

        dyIndicator.setVisibleTabCount(3);
        dyIndicator.setTabItemTitles(data);
    }




}
